<template>
  <div
    class="btn"
    :class="{ success: type == 'success', danger: type == 'danger' }"
    @click="login"
  >
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    type: {
      type: String,
    },
  },
  methods: {
    login(e) {
      this.$emit("click", e);
    },
  },
};
</script>

<style lang="less" scoped>
.btn {
  width: 318/360 * 100vw;
  height: 40px;
  border-radius: 20px;
  margin: 0 auto;
  text-align: center;
  line-height: 40px;
  color: #fff;
  font-weight: 700;
  background-color: #ccc;
}
.success {
  background-color: #0a0;
}
.danger {
  background-color: red;
}
</style>